#include "BrushEmpty.h"
#include "Character/monster/MonsterMgr.h"
#include "Character/monster/MonsterRefCfg.h"
#include "Duplicate/IDuplicate.h"

BrushEmpty::BrushEmpty() :m_pDuplicate(nullptr), m_pBrush(nullptr)
{
	m_bBrushFinish = false;
	m_bStart = false;
}

BrushEmpty::~BrushEmpty()
{
	
}

bool BrushEmpty::Init(IDuplicate *pDuplicate)
{
	if (nullptr == pDuplicate)
	{
		LogErrFmtPrint("BrushEmpty::Init...");
		return false;
	}
	m_pDuplicate = pDuplicate;
	AllBrushDataCfg *pAllBrush = m_pDuplicate->GetBrushData();
	if (nullptr == pAllBrush)
	{
		LogErrFmtPrint("BrushEmpty::Init...nullptr == pAllBrush....scene:%u,dupid:%u ",pDuplicate->GetSceneID(),pDuplicate->GetDuplicateID());
		return false;
	}
	m_pBrush = &pAllBrush->stEmpty;
	return true;
}

void BrushEmpty::UnInit()
{
	g_GetTimerAxis()->KillAllTimer(this);
	m_pDuplicate = nullptr;
	m_pBrush = nullptr;
	m_bStart = false;
	m_bBrushFinish = false;
}

void BrushEmpty::StartBrush()
{
	m_bStart = true;
}

void BrushEmpty::StopBrush()
{
	m_bStart = false;
	m_bBrushFinish = true;
}

//是否刷怪完成
bool BrushEmpty::FinishBrush()
{
	return m_bBrushFinish;
}

void BrushEmpty::BrushUpdate()
{
	if (m_bBrushFinish)
		return;
	if (m_pBrush->brushFinish())
		m_bBrushFinish = true;
}

void BrushEmpty::OnTimer(uint32_t nTimerID)
{
	switch (nTimerID)
	{
	case 1:
		break;
	default:
		break;
	}
}

